package com.peaw.util;

import java.util.List;
import java.util.Map;

/**
 * <pre>
 * <b></b>
 *
 * </pre>
 * @author MrLiberte
 * @version 1.0.0 [2016年4月25日] 
 */
public class Utils {


	public static boolean isNullOrEmpty(Object object) {
		if (null == object) {
			return true;
		} else {
			if (object instanceof String) {
				return ((String) object).isEmpty();
			} else if (object instanceof Map) {
				return ((Map<?, ?>) object).isEmpty();
			} else if (object instanceof List) {
				return ((List<?>) object).isEmpty();
			} else {
				return false;
			}
		}
	}
	
	
	public static void setNull(Object...objects) {
		if (null != objects) {
			for (int i = 0; i < objects.length; i++) {
				if (null != objects[i]) {
					objects[i] = null;
				}
			}
		}
	}
	
	public static void setNull(Object object) {
		if (null != object) {
			object = null;
		}
	}

}
